<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>教师列表</title>
</head>
<body>
<table align="center" border="1">
    <thead>
    <tr>
        <th>姓名</th>
        <th>性别</th>
    </tr>
    </thead>
    <tbody>
    {% for teacher in data %}
        <tr>
        <td>{{ teacher.name }}</td>
        <td>{{ teacher.gender }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>
<center>
    <a href="{% url 'teachers:list' 20 1 %}">
        <input type="button" value="首页">
    </a>
    {% if data.has_previous %}
        <a href="{% url 'teachers:list' 20 data.previous_page_number %}">
                <input type="button" value="上一页">
        </a>
        {% else %}
                <a href="javascript:alert('没有上一页了')">
                <input type="button" value="上一页">
        </a>
    {% endif %}
    {% if data.has_next %}
                <a href="{% url 'teachers:list' 20 data.next_page_number %}">
                <input type="button" value="下一页">
        </a>
        {% else %}
                <a href="javascript:alert('没有下一页了')">
                <input type="button" value="上一页">
        </a>
    {% endif %}
        <a href="{% url 'teachers:list' 20 paginator.num_pages %}">
        <input type="button" value="末页">
    </a>
<hr>
{{ data }}


</center>

</body>
</html>